<?php

namespace Biz\model\activity;

use Doraemon\pockets\datebase\BaseDbModel;


class ActivityBasic extends BaseDbModel implements ActivityBasicInterface
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_brand_activity';

    const _DATABASE_ = 'brand_activity';

    const _TABLE_NAME = 'activity_basic';

    /**
     * @param $activityId self::ACTIVITY_MAP 里的活动id
     * @param string $name self::ACTIVITY_MAP 里活动对应名称
     * @param string $startTime
     * @param string $endTime
     * @return void
     */
    public static function addActivity($activityId, string $name, string $startTime = '0000-00-00 00:00:00', string $endTime = '0000-00-00 00:00:00')
    {
        $res = self::insert([
            'activity_id' => $activityId,
            'name' => $name,
            'start_time' => $startTime,
            'end_time' => $endTime,
            'add_time' => date('Y-m-d H:i:s')
        ]);
        return $res->rowCount();
    }
}